﻿@model KidChoreApp.Web.Models.AddChoreToKidVM

<h3>Chores for @Model.Kid.Name</h3>


<h2>Chores Not Assigned</h2>
<table class="table table-hover table-striped">
    <tr>
        <th>Chore</th>
        <th colspan="2">Room</th>
    </tr>
    @foreach (var c in @Model.ChoresUnassigned)
    {
        <tr onclick="location.href='/Chore/ChoreDetail/@c.Id'">
            <td>@c.Name</td>
            <td>@c.Room</td>
            <td>
                <form method="post" action="/Kid/AddChoreToKid">
                    <input type="hidden" name="kidId" value="@Model.Kid.Id" />
                    <input type="hidden" name="choreId" value="@c.Id" />
                    <input type="submit" value="+" class="btn btn-success btn-sm" />
                </form>
            </td>
        </tr>
    }
</table>

<h2>Chores Assigned</h2>
<table class="table table-hover table-striped">
    <tr>
        <th>Chore</th>
        <th colspan="2">Room</th>
    </tr>
    @foreach (var c in @Model.ChoresAssigned)
    {
        <tr onclick="location.href='/Chore/ChoreDetail/@c.Id'">
            <td>@c.Name</td>
            <td>@c.Room</td>
            
        </tr>
    }
</table>
<a class="btn btn-success btn-block" href="/Kid/KidDetail/@Model.Kid.Id">Back to Details for @Model.Kid.Name</a>

